package com.outsourcingmanagesystem.controller;

import com.outsourcingmanagesystem.service.LeaderService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.tags.Tags;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Tags(@Tag(name = "领导模块"))
@RestController
@RequestMapping("/leader")
public class LeaderController {

    @Autowired
    private LeaderService leaderService;

    @PutMapping("/approve")
    @Operation(summary = "审批通过")
    public String approveOnDuty(Integer userId) {
        leaderService.approveOnDuty(userId);
        return "success";
    }

    @PutMapping("/reject")
    @Operation(summary = "审批拒绝")
    public String rejectOnDuty(Integer userId) {
        leaderService.rejectOnDuty(userId);
        return "success";
    }


}
